Getting selected values from multiselect list

How can I get the values selected from a multiselect list?
 

get(element)

 


only gets the 1st item selected.

 


homer_3 - Mon Feb 28 17:09:06 EST 2011

Re: Getting selected values from multiselect list
homer_3 - Mon Feb 28 18:04:16 EST 2011

Or is there a way to programmatically deselect a given element? If there is, I could write my own function that gets all selected values.

Re: Getting selected values from multiselect list
llandale - Mon Feb 28 18:57:53 EST 2011

Look up "selected" and "set" for multiList.

Here's an actual function to toggle them on or off; if any are selected they are all turned off otherwise all turned on.

//*************************************************
void    btnCheck_Toggle(DBE dbeXX)
{     // Toggle all the Error Selections either on or off
 
        bool    YesSet
        int     i
 
        YesSet  = true
        for (i=0; i<c_Check_ErrTypes_Size; i++)
        {  if (selected(dbeCheck_ErrTypes, i)) YesSet = false
        }
        
        for (i=0; i<c_Check_ErrTypes_Size; i++)
        {  set(dbeCheck_ErrTypes, i, YesSet)
        }
}     // end btnCheck_Toggle()


Here is the definition of the DBE:

 

dbeCheck_ErrTypes =  multiList(dbQACheck, "Find these Error-Types:", 180, c_Check_ErrTypes_Size+1, c_Check_ErrTypes)


c_Check_ErrTypes_Size is the size of string c_Check_ErrTypes[].

 

 

 

  • Louie